<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

  
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html >
<html>
<head>
		<title></title>
		<style type="text/css">
		#e{
		
			height:40px;
			margin-top: 20px;
		}
		</style>
		<!--适配于手机终端和PAD等移动终端，禁止缩放-->
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta charset="UTF-8" />
		<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
	</head>

<body>
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
		<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
		
		
		
		<%
		 String A = null;
		 Cookie[] cookies = request.getCookies();
		if(cookies != null){
			
			for(Cookie c: cookies){
				if(c.getName().startsWith("name")){
					
					A = c.getValue();
				}
			}
		} 
		int B =0;//记住用户名  
		Object rem = request.getAttribute("rem");
		if(rem != null){
			B =1;
		}
		 
		%>
		
		<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<div class="row clearfix">
				<div class="col-md-4 column">
					<div class="page-header">
						<h1>
							登录 <small>管理后台系统</small>
						</h1>
					</div>
				</div>
				<div class="col-md-4 column">
				</div>
				<div class="col-md-4 column">
				</div>
			</div>
			<div class="row clearfix">
				<div class="col-md-4 column">
				</div>
				<div class="col-md-4 column">
					<form class="form-horizontal" method="get" action="user.action">
				
				<%
				
				 if(B ==0){
				%>
				
						<div class="form-group">
							 <label for="inputEmail3" class="col-sm-2 control-label">账号</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" name="t_user.name" />
							</div>
						</div>
						<% 	
				}else{
				%>
						  
					<div class="form-group">
							 <label for="inputEmail3" class="col-sm-2 control-label">账号</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" name="t_user.name" value=${rem}>
							</div>
						</div>
					
					<% } %>	
						
						<div class="form-group">
							 <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
							<div class="col-sm-10">
								<input type="password" class="form-control" name="t_user.password" />
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<div class="checkbox">
								</div>
								<%
				
				 if(B ==0){
				%>
				
									 <label><input type="checkbox" name="remember" checked="checked"/>记住我</label>
									 
									 		<% 	
				}else{
				%>
					
									 <label><input type="checkbox" name="remember" />记住我</label>
									<% } %>	 
							</div>
						</div>
						
						
								<div class="form-group">
						<label for="inputEmail3" class="col-sm-2 control-label">验证</label>
						<div class="col-sm-10">
							<input type="text" name="valiCode" /><br /> <img id="img1"
								name="code" src="${pageContext.request.contextPath }/code"
								alt="验证" onclick="f1()" />
						</div>
					</div>
						
						
			
						
						
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								 <button type="submit" class="btn btn-default">登录</button>
								 <a class="btn btn-default" href="${pageContext.request.contextPath }/wzq/register.jsp">注册</a><br/>
								 <!--  <a href="${pageContext.request.contextPath }/mmy/forget.jsp">忘记密码</a> -->
							</div>
						</div>
					</form>
					
					
					
					
				</div>
				<div class="col-md-4 column">
				</div>
			</div>
		</div>
	</div>
</div>



<script type="text/javascript">
function f1(){
	var img = document.getElementById("img1");
	//欺骗浏览 每次发送的请求地址不同
	img.src="code?" + Math.random();
}

	</script>

</body>
</html>